#!/bin/sh
#
# this script handles the btpd daemon process
# and unicgi script

mos=/usr/local/etc/mos/bittorrent
package=/usr/local/bin

unicgi_start(){
	echo "Starting unicgi..."
	mv /tmp/www/index.html /tmp/www/index
	cp -r /tmp_orig/www/* /tmp/www/
	mv -f /tmp/www/index.html /tmp/www/WebTorrentHome.html
	mv -f /tmp/www/index /tmp/www/index.html
	return 0;
}

unicgi_stop(){
	echo "Stopping unicgi..."
	#mv /tmp/www/index.html /tmp/www/index
	#rm -f /tmp/www/cgi-bin/UniCGI.cgi
	#rm -f /tmp/www/WebTorrentHome.html
	#rm -f /var/www/*.htm*
	#rm -f /var/www/*.js
	#rm -fr /var/www/image
	#rm -fr /var/www/log
	#mv /tmp/www/index /tmp/www/index.html
	return 0;
}

case "$1" in
	start)
		#$package/btpd.sh start
		unicgi_start
		;;
	stop)
		unicgi_stop
		#$package/btpd.sh stop
		;;
	status)
		#$package/btpd.sh status
		;;
	enable | disable)
		;;
	*)
      	echo $"Usage: $0 {start|stop|status}"
		exit 1
esac

exit $?
